package com.dtx.qiku.sessionstore;

import com.dtx.qiku.store.Store;

import java.io.IOException;
import java.util.List;

public class SessionStore implements Store {

    private Store fileStore;

    public SessionStore(Store fileStore) {
        this.fileStore = fileStore;
    }

    @Override
    public <T> List<T> read(String tableName, Class<T> clz) throws IOException {
        return this.fileStore.read("store.session",clz);
    }

    @Override
    public <T> void write(String tableName, List<T> data) throws IOException {
        this.fileStore.write("store.session",data);
    }

    public void write(List<Session> data) throws IOException{
        this.write(null,data);
    }

    public List<Session> read() throws IOException{
        return this.read(null,Session.class);
    }


}
